/*
 * Copyright 2010 Biz-e (info@biz-e.nl)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.site.client.editor;

import nl.biz_e.site.shared.models.Version;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;

/**
 * TODO: Write type comment
 * 
 * @author Joost A. Bloemsma
 */
public class VersionsTable extends Composite {
    private final VersionsPanel mainPanel;
    private FlexTable grid;

    /**
     * Constructs a new VersionsTable instance
     * 
     * @param mainPanel
     */
    VersionsTable(VersionsPanel mainPanel) {
        super();
        this.mainPanel = mainPanel;
        grid = new FlexTable();
        this.initWidget(grid);
    }

    /**
     * 
     */
    public void reset() {
        grid.removeAllRows();
        grid.setWidget(0, 0, new Label(" "));
        grid.setWidget(0, 1, new Label("Version"));
        grid.setWidget(0, 2, new Label("Date"));
        grid.setWidget(0, 3, new Label("Author"));
    }

    /**
     * @param version
     */
    public void addVersion(Version version) {
        // TODO Implement this
    }

    /**
     * @return the mainPanel
     */
    public VersionsPanel getMainPanel() {
        return mainPanel;
    }
}
